/*
 * @Author: 秦福凯
 * @LastEditTime: 2025-01-02 17:17:27
 * @Description: 前端路由权限
 */
import { defineStore } from 'pinia';
// import { subMenuList } from "@/api";

interface ObjectList {
	[key: string]: string[];
}

/* 设置用户白名單路由*/
const routers = [
	'subSystem',
	'userCenter',
]

const usePermissStore = defineStore('permiss', {
	state: () => {
		return {
			permiss: JSON.parse(sessionStorage.getItem('permiss')) || [], //页面访问权限
			permissions: JSON.parse(sessionStorage.getItem('permissions')) || [], //按钮控制权限
		}
	},
	getters: {
		permissList: state => {
			return state.permiss
		},
		permissionsList: state => {
			return state.permissions
		},
	},
	actions: {
		addPermiss(val: string) {
			this.permiss.push(val);
		},
		//获取用户权限
		getUserPermiss() {
			return new Promise((resolve, reject) => {
				
			})
		},
	},
});

export default usePermissStore
